/*
 * Copyright 2008-2009 Aying.Net Powered by Fuchun.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.aying.text;

import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;

/**
 * {@code TextResources} 接口的默认实现类。
 * 
 * @author  Fuchun
 * @version 1.0, 2009-07-05
 */
public class DefaultTextResources implements TextResources {
    
    private Class<?> clazz;
    private Locale locale;
    private ResourceBundle bundle;
    
    /**
     * 构造一个新的 {@code DefaultTextResources} 实例。
     */
    public DefaultTextResources() {
    }
    
    /**
     * 根据给定的 {@code class} 对象和给定的语言环境构造一个新的 {@code DefaultTextResources} 实例。
     * 
     * @param clazz 给定的 {@code class} 对象
     * @param locale 给定的语言环境。
     */
    public DefaultTextResources(Class<?> clazz, Locale locale) {
        this.clazz = clazz;
        this.locale = locale;
    }
    
    /**
     * 根据给定资源包和给定的语言环境构造一个新的 {@code DefaultTextResources} 实例。
     * 
     * @param bundle 给定的资源包。
     * @param locale 给定的语言环境。
     */
    public DefaultTextResources(ResourceBundle bundle, Locale locale) {
        this.bundle = bundle;
        this.locale = locale;
    }

    /**
     * @see net.aying.text.TextResources#containsKey(java.lang.String)
     */
    public boolean containsKey(String key) {
        // TODO Auto-generated method stub
        return false;
    }

    /**
     * @see net.aying.text.TextResources#getBundle(java.lang.String)
     */
    public ResourceBundle getBundle(String bundleName) {
        // TODO Auto-generated method stub
        return null;
    }

    /**
     * @see net.aying.text.TextResources#getLocale()
     */
    public Locale getLocale() {
        return locale;
    }

    /**
     * @see net.aying.text.TextResources#getText(java.lang.String)
     */
    public String getText(String key) {
        // TODO Auto-generated method stub
        return null;
    }

    /**
     * @see net.aying.text.TextResources#getText(java.lang.String, java.lang.String)
     */
    public String getText(String key, String defaultValue) {
        // TODO Auto-generated method stub
        return null;
    }

    /**
     * @see net.aying.text.TextResources#getText(java.lang.String, java.lang.Object[])
     */
    public String getText(String key, Object... args) {
        // TODO Auto-generated method stub
        return null;
    }

    /**
     * @see net.aying.text.TextResources#getText(java.lang.String, java.util.List)
     */
    public String getText(String key, List<String> args) {
        // TODO Auto-generated method stub
        return null;
    }

    /**
     * @see net.aying.text.TextResources#getText(java.lang.String, java.lang.String, java.lang.Object[])
     */
    public String getText(String key, String defaultValue, Object... args) {
        // TODO Auto-generated method stub
        return null;
    }

    /**
     * @see net.aying.text.TextResources#getText(java.lang.String, java.lang.String, java.util.List)
     */
    public String getText(String key, String defaultValue, List<String> args) {
        // TODO Auto-generated method stub
        return null;
    }

    /**
     * @see net.aying.text.TextResources#setBundle(java.util.ResourceBundle)
     */
    public void setBundle(ResourceBundle bundle) {
    // TODO Auto-generated method stub

    }

    /**
     * @see net.aying.text.TextResources#setClazz(java.lang.Class)
     */
    public void setClazz(Class<?> clazz) {
        this.clazz = clazz;
    }

    /**
     * @see net.aying.text.TextResources#setLocale(java.util.Locale)
     */
    public void setLocale(Locale locale) {
        if(locale == null)
            this.locale = Locale.getDefault();
        else
            this.locale = locale;
    }
}
